<template>
	<view class="youhuiquan">
		<view class="list">
			<view class="item" v-for="(item,index) in list" :key="index" @click="handlexiangqing(item)">
				<view class="item-box">
					<view class="item-box-zhekou">
						<text class="item-box-zhekou-text1">￥</text>
						<text class="item-box-zhekou-text">{{item.money}}</text>
					</view>
					<view class="daoqi">
						{{item.endDays}}
					</view>
				</view>
				<view class="item-box1">
					<view class="item-box1-view">满 {{item.minUseMoney}} 可用</view>
					<view class="item-box1-view1">{{item.startTime}} 至 {{item.endTime}}</view>
				</view>
				
				<!-- <image v-if="categoryListIndex == 0" class="item-image1" src="../../static/yhq_ysy@2x.png" mode=""></image> -->
				<image v-if="item.status == 1" class="item-image1" src="../../static/yhq_ydq@2x.png" mode=""></image>
			</view>
		</view>
		
		<view class="empty" v-if="showEmpty">
			<text>暂无优惠券</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[],
				showEmpty:false,
				share:uni.getStorageSync('share')
			}
		},
		onLoad(options) {
			if (options.couponList) {
				console.log(111)
				this.list = JSON.parse(options.couponList)
				if (this.list.length == 0) {
					this.showEmpty = true
				}
			}
			
			
		},
		methods: {
			
			//优惠券详情选择
			handlexiangqing(data){
				uni.$emit('refreshYouhuiquan', data)
				uni.navigateBack({
					delta: 1
				})
			}
		},
		
	}
</script>
<style>
	page{
		background: #FBFBFB;
	}
</style>
<style scoped lang="scss">
    .category{
		width: 750rpx;
		padding: 28rpx 160rpx 0rpx 160rpx;
		background: white;
		position: fixed;
		top: 0;
		left: 0;
		z-index: 10;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
	}
	.category-item{
		display: flex;
		flex-direction: column;
		align-items: center;
	}
	.active-category-item-name{
		font-size: 28rpx;
		font-family: PingFang SC-Bold, PingFang SC;
		font-weight: bold;
		color: #333333;
		line-height: 32rpx;
	}
	.category-item-name{
		font-size: 28rpx;
		font-family: PingFang SC-Bold, PingFang SC;
		font-weight: 400;
		color: #333333;
		line-height: 32rpx;
	}
	.xian{
		margin-top: 28rpx;
		width: 40rpx;
		height: 4rpx;
		background: #333333;
		border-radius: 0px 0px 0px 0px;
	}
	.list{
		padding: 28rpx 28rpx 28rpx 28rpx;
	}
	.item{
		margin-bottom: 28rpx;
		width: 694rpx;
		height: 198rpx;
		background: url('http://hmh-app.oss-cn-beijing.aliyuncs.com/webStorage/web_16919793120464245.png') no-repeat;
		background-size: 100% 100%;
		display: flex;
		flex-direction: row;
		align-items: center;
		position: relative;
	}
	.item-image1{
		position: absolute;
		right: 0;
		top: 0;
		width: 144rpx;
		height: 198rpx;
	}
	.item-box{
		width: 330rpx;
		height: 198rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}
	.item-box-zhekou{
		display: flex;
		flex-direction: row;
		align-items: flex-end;
	}
	.item-box-zhekou-text{
		font-size: 56rpx;
		font-family: Arvo-Regular, Arvo;
		font-weight: 400;
		color: #ffffff;
		line-height: 66rpx;
	}
	.item-box-zhekou-text1{
		font-size: 32rpx;
		font-family: Arvo-Regular, Arvo;
		font-weight: 400;
		color: #ffffff;
		line-height: 50rpx;
	}
	.daoqi{
		padding: 2rpx 12rpx;
        background: #ffffff;
		margin-top: 16rpx;
		font-size: 22rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #A979F5;
		line-height: 26rpx;
	}
	.item-image{
		width: 24rpx;
		height: 198rpx;
	}
	.item-box1{
		padding-left: 48rpx;
	}
	.item-box1-view{
		font-size: 32rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #ffffff;
		line-height: 38rpx;
	}
	.item-box1-view1{
		margin-top: 28rpx;
		font-size: 24rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #ffffff;
		line-height: 28rpx;
	}
	
	
	.empty{
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		margin-top: 350rpx;
	}
	.empty image{
		width: 238rpx;
		height: 76rpx;
	}
	.empty text{
		margin-top: 30rpx;
		font-size: 32rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #333333;
		line-height: 44rpx;
	}
	
	.empty{
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		margin-top: 350rpx;
	}
	.empty image{
		width: 238rpx;
		height: 76rpx;
	}
	.empty text{
		margin-top: 30rpx;
		font-size: 32rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #333333;
		line-height: 44rpx;
	}
</style>
